﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BusinessObjects.BusinessRules;

namespace BusinessObjects.Production
{
    public class InwardOutward : BusinessObject
    {
        public InwardOutward()
        {
            AddRule(new ValidateRequired("RefNo"));
            AddRule(new ValidateLength("RefNo", 0, 20));

            AddRule(new ValidateRequired("AccountingObjectID"));

            AddRule(new ValidateRequired("RestaurantID"));
        }

        public InwardOutward(string refId, int refType, DateTime refDate, DateTime postedDate, string refNo, string accountingObjectId, string accountingObjectName,
                                string employeeId, string accountingObjectAddress, string journalMemo, string currencyId, decimal exchangeRate, bool isImportPurchase,
                                string shippingMethodId, decimal totalAmount, string restaurantId, bool isPosted, bool isMaterial)
            : this()
        {
            RefID = refId;
            RefType = refType;
            RefDate = refDate;
            PostedDate = postedDate;
            RefNo = refNo;
            EmployeeID = employeeId;
            AccountingObjectID = accountingObjectId;
            AccountingObjectName = accountingObjectName;
            AccountingObjectAddress = accountingObjectAddress;
            JournalMemo = journalMemo;
            CurrencyID = currencyId;
            ExchangeRate = exchangeRate;
            IsImportPurchase = isImportPurchase;
            ShippingMethodID = shippingMethodId;
            TotalAmount = totalAmount;
            RestaurantID = restaurantId;
            IsPosted = isPosted;
            IsMaterial = isMaterial;
        }

        public string RefID { get; set; }

        public int RefType { get; set; }

        public DateTime RefDate { get; set; }

        public DateTime PostedDate { get; set; }

        public string RefNo { get; set; }

        public string EmployeeID { get; set; }

        public string AccountingObjectID { get; set; }

        public string AccountingObjectName { get; set; }

        public string AccountingObjectAddress { get; set; }

        public string JournalMemo { get; set; }

        public string CurrencyID { get; set; }

        public decimal ExchangeRate { get; set; }

        public bool IsImportPurchase { get; set; }

        public string ShippingMethodID { get; set; }

        public decimal TotalAmount { get; set; }

        public string RestaurantID { get; set; }

        public bool IsPosted { get; set; }

        public bool IsMaterial { get; set; }
    }
}
